<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tlds/custom-html.tld" prefix="chtml" %>

<%@ page import="com.erp.framework.util.CommonUtil"%>
<%@ page import="com.erp.app.common.ProjectConstants"%>
<%@ page import="com.erp.app.catalog.login.web.CatalogLoginAction"%>

<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.Hashtable"%>
<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.Iterator"%>

<meta http-equiv="Content-Type" content="text/html; charset=big5">
<link rel="stylesheet" href="stylesheet/style1.css" type="text/css">
<link href="<%= request.getContextPath()%>/css/catalogCss/global.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath()%>/css/catalogCss/buttons.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath()%>/css/catalogCss/forms.css" rel="stylesheet" type="text/css" />
<link href="<%= request.getContextPath()%>/css/catalogCss/tables.css" rel="stylesheet" type="text/css" />

<jsp:useBean id="catalogLoginForm" scope="session" type="com.erp.app.catalog.login.web.CatalogLoginForm" />


<table class="table_grid">
	<tr class="grid_header">
		<td class="grid_header_col" nowrap>
			<html:text useExtensions="true" uiType="label" childTsIndex="current" name="catalogLoginForm" property="lblCategoryImage"/>
		</td>
		<td class="grid_header_col" nowrap>
			<html:text useExtensions="true" uiType="label" childTsIndex="current" name="catalogLoginForm" property="lblCategoryContent"/>
		</td>
	    <td class="grid_header_col" nowrap>
			<html:text useExtensions="true" uiType="label" childTsIndex="current" name="catalogLoginForm" property="lblCategoryArticleNumber"/>
		</td>
	    <td class="grid_header_col" nowrap>
			<html:text useExtensions="true" uiType="label" childTsIndex="current" name="catalogLoginForm" property="lblCategoryDescription"/>
		</td>
    </tr>
    <logic:present  name="catalogLoginForm" property="itemMasterVos">    	
		<logic:iterate id="itemVo" name="catalogLoginForm" property="itemMasterVos" indexId="idx"  type="com.erp.app.catalog.itemMaster.vo.ItemMasterVO">
		<%
		System.out.println(" idx : "+idx);
		System.out.println("itemVo.getFabricCode():"+itemVo.getFabricCode());
		%>
			<%if (idx.intValue()>=catalogLoginForm.getSidx() && idx.intValue()<(catalogLoginForm.getSidx()+CatalogLoginAction.MAX_SHOW_PAGE)){%>
			<tr <%=(idx.intValue()%2 == 0)? "class='grid_result1'": "class='grid_result2'"%>>
				<td class="grid_outline" nowrap="nowrap" width="100">					
					<img src="<%=catalogLoginForm.getSearchImageFile(request, itemVo, idx.intValue())%>"	
						width="96" height="96" border="0" />
				</td>
				<td class="grid_outline" nowrap="nowrap">
					
					<bean:write name="itemVo" property="content"/>
				</td>
				<td class="grid_outline" nowrap="nowrap">
				    <a href = "catalogLogin.do?pageEvent=<%=CatalogLoginAction.ACTION_ITEM_PIC_DETAIL%>&pageEventSrc=<%=itemVo.getFabricCode()%>">
						<bean:write name="itemVo" property="fabricCode"/>
					</a>
				</td>
				<td class="grid_outline">
					<p>												
						<bean:write name="itemVo" property="itemDesc"/>
					</p>
				</td>
			</tr>
			<%}%>
		</logic:iterate>
	</logic:present>	  
</table>